package com.annotation.aop;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author: qiuli
 * @date: 2022/1/17 13:21
 * @description:
 */


public class MainConfigOfAOPTest {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOfAOP.class);
        //1.不要自己创建对象
        //MathCalculator mathCalculator = new MathCalculator();
        //mathCalculator.div(1, 1);
        //我们要中容器中获取组件
        MathCalculator mathCalculator = applicationContext.getBean(MathCalculator.class);
        mathCalculator.div(1, 1);
    }
}
